// ==============================================================================================
// OfficeApp.cs
//
// Created by: NI, 2007.03.26
// Revised by: NI, 2007.11.23
// ==============================================================================================
using System.Collections.Generic;
using RibbonExplorer.Entities;

namespace RibbonExplorer.Entities
{
  /// <summary>
  /// This class represents an Office application with its assigned ribbons.
  /// </summary>
  // ==============================================================================================
  public sealed class OfficeApp: ItemBase
  {
    #region Private fields

    private string _Name;
    private List<Ribbon> _Ribbons = new List<Ribbon>();

    #endregion

    #region Lifecycle methods

    // --------------------------------------------------------------------------------------------
    /// <summary>
    /// Creates an Office application instance with the specified ID and name.
    /// </summary>
    /// <param name="id">Office application ID</param>
    /// <param name="name">Application name</param>
    // --------------------------------------------------------------------------------------------
    public OfficeApp(string id, string name): base(id)
    {
      _Name = name;
      _ChildrenLoaded = true;
    }

    #endregion

    #region Public properties

    // --------------------------------------------------------------------------------------------
    /// <summary>
    /// Gets the name of the office application.
    /// </summary>
    // --------------------------------------------------------------------------------------------
    public string Name
    {
      get { return _Name; }
    } 
    
    // --------------------------------------------------------------------------------------------
    /// <summary>
    /// Gets the dictionary of ribbons held by the office application.
    /// </summary>
    // --------------------------------------------------------------------------------------------
    public List<Ribbon> Ribbons
    {
      get { return _Ribbons; }
    }

    #endregion

    #region Public methods

    // --------------------------------------------------------------------------------------------
    /// <summary>
    /// Adds a ribbo to the Office application.
    /// </summary>
    /// <param name="ribbon">Ribbon To add</param>
    // --------------------------------------------------------------------------------------------
    public void AddRibbon(Ribbon ribbon)
    {
      _Ribbons.Add(ribbon);
    }

    #endregion
  }
}